<template>
  <div class="app">
    <h2>{{ message }}</h2>
    <home></home>
    <button @click="isShowCategory = !isShowCategory">是否显示Category</button>
    <category v-if="isShowCategory"></category>
  </div>
</template>

<script>
  import Home from './Home.vue'
  import eventBus from './utils/event-bus'
  import Category from './Category.vue'
  
  export default {
    components: {
      Home,
      Category
    },
    data() {
      return {
        message: "Hello App",
        isShowCategory: true
      }
    },
    created() {
      // fetch()
      // 事件监听
      eventBus.on("eventBannerClick", (name, age, info) => {
        console.log("eventBannerClick:事件监听: ", name, age, info)
        this.message = `信息: ${name}`
      })
    }
  }
</script>

<style scoped>
</style>